<?php

namespace App\Model\form;

use App\Constants\ConstCode;
use App\Model\MobilePool;

trait MobilePoolTrait
{
    /**
     * 获取号码数据
     * @param  $where
     * @return array
     */
    public function getMobilePool($where): array
    {
        $result = MobilePool::where($where)->first();
        return !empty($result) ? $result->toArray() : [];
    }

    /**
     * 获取号码池号码
     * @param  $where
     * @return array
     */
    public function getMobilePoolInfo($where): array
    {
        $result = MobilePool::where($where)->first();
        return !empty($result) ? $result->toArray() : [];
    }

    /**
     * 获取号码池号码
     * @param  $where
     */
    public function getMobilePoolByOrder($where, $order)
    {
        return MobilePool::where($where)->orderBy($order)->first();
    }

}